#pragma once

class StopWatch
{
public:
	StopWatch(DWORD& runTime)
		:m_runTime(runTime)
	{
		QueryPerformanceFrequency(&m_freqtime);
		QueryPerformanceCounter(&m_startTime);
	}

	~StopWatch(void)
	{
		LARGE_INTEGER endtime = {0};
		QueryPerformanceCounter(&endtime);
		m_runTime = (DWORD)((endtime.QuadPart - m_startTime.QuadPart) *1000 / m_freqtime.QuadPart);
	}
private:
	LARGE_INTEGER m_startTime;
	LARGE_INTEGER m_freqtime;
	DWORD& m_runTime;
};
